package ooday04exercise;
import java.util.Timer;
import java.util.TimerTask;


public class TimerDemo02 {
    public static void main(String[] args) {
        Timer timer2=new Timer();
        int interval=2000;
        timer2.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("该回家了。。。。");
            }
        },interval,interval);

    }
}
